home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programmierung
/
Power-Programmierung (Tewi)(1994).iso
/
magazine
/
nan_news
/
toolkit
/
dirfunc.asm
< prev
next >
Wrap
Assembly Source File
|
1991-08-15
|
3KB
|
78 lines
; File......: DIRFUNC.ASM
; Author....: Ted Means
; Date......: $Date: 15 Aug 1991 23:06:42 $
; Revision..: $Revision: 1.2 $
; Log file..: $Logfile: E:/nanfor/src/dirfunc.asv $
;
; This is an original work by Ted Means and is placed in the
; public domain.
;
; Modification history:
; ---------------------
;
; $Log: E:/nanfor/src/dirfunc.asv $
;
; Rev 1.2 15 Aug 1991 23:06:42 GLENN
; Forest Belt proofread/edited/cleaned up doc
;
; Rev 1.1 14 Jun 1991 19:54:24 GLENN
; Minor edit to file header
;
; Rev 1.0 01 Apr 1991 01:03:12 GLENN
; Nanforum Toolkit
;
;
Public __ftdir
Extrn __ParInfo:Far
Extrn __ParC:Far
Extrn __RetNI:Far
Segment _NanFor Word Public "CODE"
Assume CS:_NanFor
Proc __ftdir Far
Push BP ; Save BP
Mov BP,SP ; Set up stack reference
Xor AX,AX ; Prepare to count params
Push AX ; Save on stack
Call __ParInfo ; Call parameter info routine
Or AX,AX ; Zero params?
JNE Test1 ; If not zero, continue
Mov AX,99 ; Set return value
Jmp Short Done ; Go to end
Test1: Mov AX,1 ; Check parameter #1
Push AX ; Save parameter # on stack
Call __ParInfo ; Call parameter info routine
Test AX,1 ; See if parameter is character
JNZ Get1 ; If so, continue
Mov AX,99 ; Set return value
Jmp Short Done ; Go to end
Get1: Mov AX,1 ; Select parameter #1
Push AX ; Save parameter # on stack
Call __ParC ; Retrieve parameter
Push DS ; Save DS
Mov DS,DX ; Load pathspec segment
Mov DX,AX ; Load pathspec offset
Mov AH,[Byte Ptr BP + 7] ; Get requested DOS service
Int 21h ; Call DOS
Pop DS ; Restore DS
JC Done ; Carry flag means error
Xor AX,AX ; Set return value
Done: Push AX ; Save return value on stack
Call __RetNI ; Return value to Clipper app
Mov SP,BP ; Realign stack
Pop BP ; Restore BP
Ret
Endp __ftdir
Ends _NanFor
End